#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
//https://www.luogu.com.cn/problem/B3736
using namespace std;

int x, y, z;


int gcd(int a, int b)
{
	if (b == 0)return a;
	return gcd(b, a % b);
}

int main()
{
	cin >> x >> y >> z;

	cout << gcd(gcd(x, y), z) << endl;


	return 0;
}